﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security;
using Microsoft.Exchange.WebServices.Data;

namespace Microsoft.Exchange.WebServices.Authentication
{
    public interface IUserData
    {
        ExchangeVersion Version { get; }
        string EmailAddress { get; }
        SecureString Password { get; }
        Uri AutodiscoverUrl { get; set; }
    }

    public class UserData : IUserData
    {
        private static UserData userData;

        public static IUserData CreateUserData(string emailaddress)
        {
            if (userData == null)
            {
                GetUserData(emailaddress);
            }

            return userData;
        }

        private static void GetUserData(string emailaddress)
        {
            userData = new UserData();

            
            userData.EmailAddress = emailaddress;

            //      userData.Password = new SecureString();

            
        }

        public ExchangeVersion Version { get { return ExchangeVersion.Exchange2010_SP1; } }

        public string EmailAddress
        {
            get;
            private set;
        }
        
        public SecureString Password
        {
            get;
            private set;
        }


        public Uri AutodiscoverUrl
        {
            get;
            set;
        }

        public static IUserData CreateUserData(string p, TraceListener traceListener)
        {
            throw new NotImplementedException();
        }
    }
}
